package com.hnevc.yinqi;

import java.util.Scanner;

public class Work17 {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        System.out.println("请输入一个矩形的长宽");
        int a= sr.nextInt();
        int b= sr.nextInt();
        for (int i=0;i<b;i++){
            for (int y=0;y<a;y++){
                if (i==0||i==b-1||y==0||y==a-1)
                    System.out.print("*");
                else
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
}
